import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-09-24
 * Time: 21:26
 */
public class test_3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int k = in.nextInt();
            long sum = 0;
            PriorityQueue<Integer> priorityQueue = new PriorityQueue<>((a, b) -> (b - a));
            for (int i = 0; i < n; i++) {
                int num = in.nextInt();
                if (num % 2 == 0) {
                    priorityQueue.offer(num);
                }
                sum += num;
            }

            for (int i = 0; i < k; i++) {
                if (priorityQueue.isEmpty()){
                    break;
                }
                int tmp=priorityQueue.poll();
                tmp/=2;
                sum-=tmp;
                if (tmp%2==0){
                    priorityQueue.offer(tmp);
                }
            }
            System.out.println(sum);

        }
    }
}
